package aer.SalvemosLinceIberico;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class SalvemosLinceIberico {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int casos = Integer.parseInt(br.readLine());

		for (int i = 0; i < casos; i++) {
			String linea = br.readLine();
			int tuneles = 0;

			for (int j = 0; j < linea.length(); j++) {
				if (linea.charAt(j) == '.') {
					tuneles++;
					j += 2;
				}
			}
			System.out.print(tuneles + "\n");

		}

	}

}
